import {
	request
} from './httpRequest.js'
module.exports = {
	userInfo: function(opration) {
		request('/api/users/getUserInfo', 'GET', {}).then(res => {
			if (opration && opration.success) {
				opration.success(res)
			}
		}).catch(err => {
			if (opration && opration.fail) {
				opration.fail(err)
			}
		})
	},
	userBanlace: function(option) {
		request('/api/user_center/cashInfo', 'GET', {}).then(res => {
			console.log(res)
			if (option && option.success) {
				option.success(res)
			}

		}).catch(err => {
			console.log(err)
			if (option && option.fail) {
				opration.fail(err)
			}
		})
	},
	userBankCard: function(option) {
		request('/api/user_center/bankCardList', 'GET', {}).then(res => {
			if (option && option.success) {
				option.success(res)
			}
		}).catch(err => {
			console.log(err)
			if (option && option.fail) {
				opration.fail(err)
			}
		})
	},
	sendValidaCode: function(option) {
		request('/api/users/sendPhone', 'POST', option.data, false).then(res => {
			if (option && option.success) {
				option.success(res)
			}
		}).catch(err => {
			console.log(err)
			if (option && option.fail) {
				opration.fail(err)
			}
		})
	}
}
